package yuan.redislearnz.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;


@RestController
@Slf4j
public class BaseController {


    @Autowired
    private StringRedisTemplate stringTemplate;

    private static final String RedisHelloWorldKey = "SpringBootRedis:HelloWorld";



    @PostMapping("/hello/world/put")
    public String helloworld(@RequestParam String helloName) {
        stringTemplate.opsForValue().set(RedisHelloWorldKey, helloName);
        return "hello world";
    }

    @GetMapping("/xxxx/..;/admin/index")
    public String sdf(){
        return "/xxxx/..;/admin/index";
    }
    @GetMapping("/admin/index")
    public String zxc(){
        return "/admin/index";
    }

    @GetMapping("/xxxx")
    public String s2df(){
        return "xxxx";
    }
}
